define(function () {
  "use strict";
  return function ({ res, cont}) {
    let str = "";
    for (var i = 0; i < res.length; i++) {
      str += `<li index=${res[i].id}><a href="detail.html?id=${res[i].id}"><img src=${res[i].imgs[0]} alt=""><h2>￥<span>${res[i].price}</span></h2><p>${res[i].name}</p></a>
        <span>已评价：${res[i].comment}</span>
        <button><i class="iconfont">&#xe74f</i>收藏</button>
        <button class="add" we=${res[i].weight}><i class="iconfont">&#xe600</i>加入购物车</button>
    </li>`;
    }
    cont.html(str);
  };
});
